<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <title>首页</title>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body class="app sidebar-mini rtl">
<div th:include="common/common::header"></div>
<div th:include="common/index::header"></div>
<script th:inline="javascript">
  var basePath = [[${#servletContext.contextPath}]];
</script>
<div th:include="common/chat::header"></div>
<div data-user>
  <input id="userCode" type="hidden" th:value="${user?.code}">
</div>
<!-- Navbar-->
<header class="app-header"><a class="app-header__logo" th:href="@{/index}">Swyc-layim</a>
  <!-- Sidebar toggle button--><a class="app-sidebar__toggle" href="#" data-toggle="sidebar" aria-label="Hide Sidebar"></a>
  <!-- Navbar Right Menu-->
  <ul class="app-nav">
    <!-- User Menu-->
    <li class="dropdown"><a class="app-nav__item" href="#" data-toggle="dropdown" aria-label="Open Profile Menu"><i class="fa fa-user fa-lg"></i></a>
      <ul class="dropdown-menu settings-menu dropdown-menu-right">
        <li><a class="dropdown-item" th:href="@{/logout}"><i class="fa fa-sign-out fa-lg"></i>退出登录</a></li>
      </ul>
    </li>
  </ul>
</header>
<!-- Sidebar menu-->
<!--<div th:include="common/common::header"></div>-->
<div class="app-sidebar__overlay" data-toggle="sidebar"></div>
<aside class="app-sidebar">
  <div class="app-sidebar__user"><img class="app-sidebar__user-avatar" th:src="@{${user?.headImgUrl}}" alt="User Image">
    <div>
      <p class="app-sidebar__user-name" th:text="${user?.nickname}">Username</p>
      <p class="app-sidebar__user-designation" th:text="${user?.phone}">Phone</p>
    </div>
  </div>
  <ul class="app-menu">
    <li th:each="menu:${menus}" th:if="${menu.parentId == null}" th:classappend="treeview">
      <div th:if="${menu.parentId == null && !#lists.isEmpty(menu.child)}" class="app-menu__item" href="#" data-toggle="treeview">
        <i class="app-menu__icon fa " th:classappend="${menu.mine.icon}"></i><span class="app-menu__label" th:text="${menu.mine.name}"></span><i class="treeview-indicator fa fa-angle-right"></i>
      </div>
      <div th:if="${#lists.isEmpty(menu.child)}" class="app-menu__item" th:href="@{${menu.mine.url}}" data-sign>
        <i class="app-menu__icon fa fa-dashboard"></i><span class="app-menu__label" th:text="${menu.mine.name}"></span>
      </div>
      <ul class="treeview-menu" th:if="${!#lists.isEmpty(menu.child)}">
        <li th:each="child:${menu.child}">
          <div class="treeview-item" th:href="@{${child.mine.url}}" data-sign><i class="icon fa " th:classappend="${child.mine.icon}"></i>[[${child.mine.name}]]</div>
        </li>
      </ul>
    </li>
  </ul>
</aside>
<main class="app-content">
  <iframe th:src="@{/welcome}" id="mainIframe"></iframe>
</main>
</body>
</html>